#include <functional>
#include <iostream>
#include "log.hpp"

typedef std::function<int(int,int)> func_t;
class Task
{
public:
    Task(){}
    Task(int x,int y,func_t func):
    _x(x),_y(y),_f(func)
    {}

    void operator()(const std::string& name)
    {
        //std::cout << "线程" << name << "处理完毕：" << _x << "+" << _y << "=" << _f(_x,_y) << std::endl;
        logMessage(WARNING,"线程%s 处理完毕：%d+%d = %d",name.c_str(),_x,_y,_f(_x,_y));
    }

private:
    int _x;
    int _y;
    func_t _f;
};